{template "nheader.html"}
<div class="layui-layout layui-layout-admin">
	<div class="layui-header header">
		<!-- logo区域 -->
		<div class="jqadmin-logo-box">
			<a class="logo" href="{SITE_URL}"><img src="{ADMIN_THEME}images/logo.png"></a>
		</div>
		<!-- 主菜单区域 -->
		<div class="jqadmin-main-menu">
			<ul class="layui-nav clearfix" lay-filter="main-menu">
				{loop $admin_menu $i $top}
				<li class="layui-nav-item {if !$i}layui-this{/if}">
					<a href="javascript:;"><i class="{$top.icon}"></i> {dr_lang($top.name)}</a>
				</li>
				{/loop}
			</ul>
		</div>

		<!-- 头部右侧导航 -->
		<div class="header-right">
			<ul class="layui-nav jqadmin-header-item right-menu">
				<li class="layui-nav-item first">
					<a href="javascript:;">
						<cite> {$admin.username}</cite>
						<span class="layui-nav-more"></span>
					</a>

					<dl class="layui-nav-child">
						<dd class="tab-menu">
							<a href="javascript:;" data-url="user-info.html" data-title="个人信息"> <i class="iconfont " data-icon='&#xe672;'>&#xe672; </i><span>个人信息</span></a>
						</dd>
						<dd>
							<a href=""><i class="iconfont ">&#xe64b; </i>退出</a>
						</dd>
					</dl>
				</li>
				<li class="layui-nav-item tab-menu"><a class="msg" href="javascript:;" data-url="msg.html" data-title="站内信息"><i class="iconfont" data-icon='&#xe63c;'>&#xe63c; </i><span class="msg-num">1</span></a></li>
			</ul>
			<a title="{dr_lang('更新缓存')}" href="javascript:dr_cache();" class="layui-btn layui-btn-normal fresh-btn"><i class="iconfont">&#xe62e; </i> </a>
		</div>
	</div>

	<!-- 左侧导航-->
	<div class="layui-side jqamdin-left-bar">
		<!--子菜单项-->
		<p class="jqadmin-home tab-menu">
			<a href="javascript:;" data-url="{dr_url('api/main')}" data-title="{dr_lang('后台首页')}">
				<span>&nbsp;</span>
			</a>
		</p>
		{loop $admin_menu $m $top}
		<div class="sub-menu">
			<ul class="layui-nav layui-nav-tree">
				{loop $top.link $i $t}
				{if $t.mark == 'content-model'}
				{php $model = get_model_data('content'); }
				{if $model}
				<li class="layui-nav-item">
					<a href="javascript:;" data-title="{dr_lang($t.name)}">
						<i class="{$t.icon}"></i>
						<span>{dr_lang($t.name)}</span>
						<em class="layui-nav-more"></em>
					</a>
					<dl class="layui-nav-child">
						{loop $model $m}
						<dd>
							<a href="javascript:;" data-url="{dr_url('content/index', array('modelid'=>$m.modelid))}" data-title="{dr_lang($m.modelname)}">
								<i class="fa fa-circle-thin"></i>
								<span>{dr_lang($m.modelname)}</span>
							</a>
						</dd>
						{/loop}

					</dl>
				</li>
				{/if}
				{else if $t.mark == 'content-form'}
				{php $model = get_model_data('form'); }
				{if $model}
				<li class="layui-nav-item">
					<a href="javascript:;" data-title="{dr_lang($t.name)}">
						<i class="{$t.icon}"></i>
						<span>{dr_lang($t.name)}</span>
						<em class="layui-nav-more"></em>
					</a>
					<dl class="layui-nav-child">
						{loop $model $m}
						<dd>
							<a href="javascript:;" data-url="{dr_url('form/list', array('modelid'=>$m.modelid))}" data-title="{dr_lang($m.modelname)}">
								<i class="fa fa-circle-thin"></i>
								<span>{dr_lang($m.modelname)}</span>
							</a>
						</dd>
						{/loop}

					</dl>
				</li>
				{/if}
				{else}
				<li class="layui-nav-item {if !$i && !$m}layui-this{/if}">
					<a href="javascript:;" data-url="{dr_url($t.uri)}" data-title="{dr_lang($t.name)}">
						<i class="{$t.icon}"></i>
						<span>{dr_lang($t.name)}</span>
					</a>
				</li>
				{/if}


				{/loop}
			</ul>
		</div>
		{/loop}
	</div>

	<!-- 左侧侧边导航结束 -->
	<!-- 右侧主体内容 -->
	<div class="layui-body jqadmin-body" id="jqadmin-body">
		<div class="display-arrow">
                <span class="arrow-box">
                    <i class="iconfont">&#xe616;</i>
                </span>
		</div>
		<div class="layui-tab layui-tab-card jqadmin-tab-box" id="jqadmin-tab" lay-filter="tabmenu" lay-allowclose="true" lay-notAuto="true">
			<ul class="layui-tab-title">
				<li class="layui-this" id="admin-home"><em>首页</em></li>

			</ul>
			<div class="tab-move-btn">
				<span class="move-left-btn"><i class="iconfont">&#xe616;</i></span>
				<span class="move-right-btn"><i class="iconfont ">&#xe618;</i></span>
			</div>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
					<iframe class="jqadmin-iframe" data-id='0' src="{dr_url('api/main')}"></iframe>
				</div>
			</div>
		</div>
	</div>
	<!-- 底部区域 -->
	<div class="layui-footer jqadmin-foot" id="jqadmin-footer">
		<div class="layui-mian">

			<p class="jqadmin-copyright">
				<span>2017 &copy;</span> FineCMS v2.2.0-dev
			</p>
		</div>
	</div>
</div>
</body>
<script type="text/javascript" src="{ADMIN_THEME}js/layui/layui.js"></script>
<script>

	layui.config({
		base: '{ADMIN_THEME}js/'
	}).extend({
		elem: 'jqmodules/elem',
		tabmenu: 'jqmodules/tabmenu'
	}).use('index');

	function dr_cache() {
		$.ajax({type: "GET",dataType:"json", url: "{dr_url('api/cache')}",
			success: function(json) {
				layui.use('layer', function(){
					var layer = layui.layer;
					layer.msg("{dr_lang('全站缓存更新成功')}");
				});
			},
			error: function(HttpRequest, ajaxOptions, thrownError) {
				layui.use('layer', function(){
					var layer = layui.layer;

					layer.msg("{dr_lang('全站缓存更新失败')}");
				});
			}
		});
	}

</script>

</html>